<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        ul,
        li,
        ol,
        dl,
        dt,
        dd,
        div,
        p,
        span,
        h1,
        h2,
        h3,
        h4,
        h5,
        h6,
        a {
            padding: 0px;
            margin: 0px;
        }

        a {
            color: #000;
            text-decoration: none;
        }

        .div {
            display: none;
            position: fixed;
            top: 50%;
            left: 50%;
            /* margin: -250px 0 0 -250px; */
            width: 500px;
            border: 1px solid rgba(0, 0, 0, 0.13);
            transform: translate(-50%, -50%);
            z-index: 999;
            box-shadow: 0 0 5px rgba(0, 0, 0, 0.189);
        }

        .div .log {
            position: relative;
            width: 100%;
            height: 50px;
            line-height: 50px;
            text-align: center;
            /* background-color: antiquewhite; */
            cursor: move;
        }

        .div .log .del {
            position: absolute;
            right: -5px;
            top: -10px;
            width: 30px;
            height: 30px;
            line-height: 30px;
            font-size: 13px;
            border-radius: 50%;
            background-color: blueviolet;
            cursor: default;
        }

        .cent .inp {
            width: 100%;
            height: 60px;
            line-height: 50px;
            text-align: center;
            font-size: 20px;
            margin: 20px 0;
        }

        .cent .inp input {
            outline: none;
            border: none;
            height: 25px;
            width: 50%;
            border-bottom: 1px solid black;
        }

        .div .btn {
            width: 100px;
            height: 50px;
            line-height: 50px;
            /* background-color: bisque; */
            border-radius: 15px;
            box-shadow: 0 0 3px rgba(0, 0, 0, 0.312);
            margin: 10px auto;
            text-align: center;
        }

        .dx {
            text-align: center;
            margin: 0 auto;
            font-size: 20px;
        }
    </style>
</head>

<body>
    <div class="dx">
        <a href="javascript:;">登录查看</a>
    </div>
    <div class="div">
        <div class="log">
            <h2>登录</h2>
            <div class="del"><a href="javaScript:;"></a>关闭</div>
        </div>
        <div class="cent">
            <div class="inp">
                <label for="use">用户名:</label> <input type="text" name="" id="use">
            </div>
            <div class="inp">
                <label for="paw">密&emsp;码:</label> <input type="password" name="" id="paw">
            </div>
            <div class="btn"><a href="javascriot:;">登录</a></div>
        </div>
    </div>
    <script>
        let del = document.querySelector('.del')
        let log = document.querySelector('.log')
        let dx = document.querySelector('.dx')
        let div = document.querySelector('.div')
        dx.addEventListener('click', function () {
            div.style.display = 'block'
        })
        del.addEventListener('click', function () {
            div.style.display = 'none'
        })
        log.addEventListener('mousedown', function (e) {
            let x = e.pageX - div.offsetLeft
            let y = e.pageY - div.offsetTop

            document.addEventListener('mousemove', move)
            function move(e) {
                div.style.left = e.pageX - x + 'px'
                div.style.top = e.pageY - y + 'px'
            }

            document.addEventListener('mouseup', function () {
                document.removeEventListener('mousemove', move)
                // console.log('错哦');
            })
        })
        let btn=document.querySelector('.btn')
        btn.addEventListener('click',d)
        function d(){
            location.href='http://127.0.0.1:5500/pink/js_/webAPI/BomText/%E7%9F%AD%E4%BF%A1%E9%AA%8C%E8%AF%81%E7%A0%81.html'
        }
    </script>
</body>

</html>